package com.hnzq.cloud.freshorderassembly.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hnzq.cloud.freshorderassembly.domain.FreGoodsOrder;
import com.hnzq.cloud.freshorderassembly.mapper.FreGoodsOrderMapper;
import com.hnzq.cloud.freshorderassembly.service.IFreGoodsOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 周皓月
 * @since 2022-02-06
 */
@Service
@GlobalTransactional
public class FreGoodsOrderServiceImpl extends ServiceImpl<FreGoodsOrderMapper, FreGoodsOrder> implements IFreGoodsOrderService {

    /**
     * 查询所有订单商品（中间表展示）
     * @return
     */
    @Override
    public List<FreGoodsOrder> findAllGoodsOrder() {
        return list();
    }

    /**
     * 根据单个订单id查询
     * @param orderId
     * @return
     */
    @Override
    public List<FreGoodsOrder> findGoodsOrderByOrderId(Integer orderId) {
        return list(new QueryWrapper<FreGoodsOrder>().in("order_id",orderId));
    }
}
